<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>伸缩盒-弹性盒</title>
    <style>
        .parent{
            border: 1px solid red;
            height: 300px;
            display: flex;
            /* 给父容器设置排列方式 */
            flex-direction: row;
            /* flex-direction: row-reverse;
            flex-direction: column;
            flex-direction: column-reverse; */
            /* 设置是否自动换行 */
            flex-wrap: nowrap;
            flex-wrap: wrap;
            /* 多主轴对齐方式 */
            align-content: flex-start;
            align-content: flex-end;
            align-content: center;
            align-content: space-around;
            align-content: space-between;
        }
        .child{
            background-color: blueviolet;
            /* 设置占父容器剩余空间的比例 */
            flex:200px 1;
            height: 100px;
        }
        .child:nth-child(odd){
            background-color: cyan;
            /* flex: 2; */
        }
    </style>
</head>
<body>
    <div class="parent">
        <div class="child">1</div>
        <div class="child">2</div>
        <div class="child">3</div>
        <div class="child">4</div>
        <div class="child">5</div>
    </div>
</body>
</html>